{ ***  cef_zip_reader_capi.h  *** }

  PCefZipReader = ^TCefZipReader;

  // Structure that supports the reading of zip archives via the zlib unzip API.
  // The functions of this structure should only be called on the thread that
  // creates the object.
  TCefZipReader = record
    // Base structure.
    base: TCefBase;

    // Moves the cursor to the first file in the archive. Returns true (1) if the
    // cursor position was set successfully.
    move_to_first_file: function(self: PCefZipReader): Integer; cconv;

    // Moves the cursor to the next file in the archive. Returns true (1) if the
    // cursor position was set successfully.
    move_to_next_file: function(self: PCefZipReader): Integer; cconv;

    // Moves the cursor to the specified file in the archive. If |caseSensitive|
    // is true (1) then the search will be case sensitive. Returns true (1) if the
    // cursor position was set successfully.
    move_to_file: function(self: PCefZipReader; const fileName: PCefString; caseSensitive: Integer): Integer; cconv;

    // Closes the archive. This should be called directly to ensure that cleanup
    // occurs on the correct thread.
    close: function(Self: PCefZipReader): Integer; cconv;


    // The below functions act on the file at the current cursor position.

    // Returns the name of the file.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_file_name: function(Self: PCefZipReader): PCefStringUserFree; cconv;

    // Returns the uncompressed size of the file.
    get_file_size: function(Self: PCefZipReader): Int64; cconv;

    // Returns the last modified timestamp for the file.
    {$NOTE LongInt = time_t}
    get_file_last_modified: function(Self: PCefZipReader): LongInt; cconv;

    // Opens the file for reading of uncompressed data. A read password may
    // optionally be specified.
    open_file: function(Self: PCefZipReader; const password: PCefString): Integer; cconv;

    // Closes the file.
    close_file: function(Self: PCefZipReader): Integer; cconv;

    // Read uncompressed file contents into the specified buffer. Returns < 0 if
    // an error occurred, 0 if at the end of file, or the number of bytes read.
    read_file: function(Self: PCefZipReader; buffer: Pointer; bufferSize: csize_t): Integer; cconv;

    // Returns the current offset in the uncompressed file contents.
    tell: function(Self: PCefZipReader): Int64; cconv;

    // Returns true (1) if at end of the file contents.
    eof: function(Self: PCefZipReader): Integer; cconv;
  end;

    // Create a new cef_zip_reader_t object. The returned object's functions can
    // only be called from the thread that created the object.
    tfn_cef_zip_reader_create = function(
        stream: PCefStreamReader): PCefZipReader; cdecl;

